<template>
	<view class="go-back">
		<view class="header">
			<uni-icons @click="jumpToBackFn()" type="arrow-left" color="white" size="30"></uni-icons>
			<view class="title">{{title}}</view>
			<view style="width: 55rpx;"></view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "GoBack",
		props: {
			title: {
				type: String,
				required: true // 可以设置为必需
			}
		},
		data() {
			return {

			};
		},

		methods: {
			jumpToBackFn() {
				uni.navigateBack({
					delta: 1 // 返回的页面数，1表示返回上一页
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	@import '../../uni.scss';

	.go-back {
		width: 100%;
		position: fixed;
		z-index: 999;

		.header {
			height: 80rpx;
			padding: 20rpx 40rpx;
			background-color: $bagroundColor;
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #fff;
			font-size: 38rpx
		}
	}
</style>